package o;

import android.os.Bundle;
import android.util.Log;
import androidx.annotation.MainThread;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.huawei.hms.framework.network.restclient.hwhttp.dns.DnsConfig;
import java.io.FileDescriptor;
import java.io.PrintWriter;
import o.li.a;

class le extends ld {
    static boolean ॱ = false;
    @NonNull
    private final kv ˊ;
    @NonNull
    private final c ˋ;

    static class c extends lc {
        private static final o.lf.e ˎ = new o.lf.e() {
            @NonNull
            public <T extends lc> T ˏ(@NonNull Class<T> cls) {
                return new c();
            }
        };
        private boolean ˊ = false;
        private dz<d> ˋ = new dz();

        c() {
        }

        @NonNull
        static c ˊ(lh lhVar) {
            return (c) new lf(lhVar, ˎ).ˋ(c.class);
        }

        void ˋ() {
            int ˋ = this.ˋ.ˋ();
            for (int i = 0; i < ˋ; i++) {
                ((d) this.ˋ.ˎ(i)).ᐝ();
            }
        }

        protected void ˏ() {
            super.ˏ();
            int ˋ = this.ˋ.ˋ();
            for (int i = 0; i < ˋ; i++) {
                ((d) this.ˋ.ˎ(i)).ॱ(true);
            }
            this.ˋ.ˏ();
        }

        public void ˋ(String str, FileDescriptor fileDescriptor, PrintWriter printWriter, String[] strArr) {
            if (this.ˋ.ˋ() > 0) {
                printWriter.print(str);
                printWriter.println("Loaders:");
                String str2 = str + "    ";
                for (int i = 0; i < this.ˋ.ˋ(); i++) {
                    d dVar = (d) this.ˋ.ˎ(i);
                    printWriter.print(str);
                    printWriter.print("  #");
                    printWriter.print(this.ˋ.ˋ(i));
                    printWriter.print(": ");
                    printWriter.println(dVar.toString());
                    dVar.ˎ(str2, fileDescriptor, printWriter, strArr);
                }
            }
        }
    }

    public static class d<D> extends la<D> implements a<D> {
        private kv ʻ;
        private e<D> ʼ;
        private li<D> ʽ;
        private final int ˋ;
        @NonNull
        private final li<D> ॱॱ;
        @Nullable
        private final Bundle ᐝ;

        @NonNull
        li<D> ˎ() {
            return this.ॱॱ;
        }

        public void ˏ() {
            if (le.ॱ) {
                Log.v("LoaderManager", "  Starting: " + this);
            }
            this.ॱॱ.ॱ();
        }

        public void ॱ() {
            if (le.ॱ) {
                Log.v("LoaderManager", "  Stopping: " + this);
            }
            this.ॱॱ.ˎ();
        }

        void ᐝ() {
            kv kvVar = this.ʻ;
            kz kzVar = this.ʼ;
            if (kvVar != null && kzVar != null) {
                super.ˎ(kzVar);
                ॱ(kvVar, kzVar);
            }
        }

        public void ˎ(@NonNull kz<? super D> kzVar) {
            super.ˎ(kzVar);
            this.ʻ = null;
            this.ʼ = null;
        }

        @MainThread
        li<D> ॱ(boolean z) {
            if (le.ॱ) {
                Log.v("LoaderManager", "  Destroying: " + this);
            }
            this.ॱॱ.ˋ();
            this.ॱॱ.ॱॱ();
            e eVar = this.ʼ;
            if (eVar != null) {
                ˎ(eVar);
                if (z) {
                    eVar.ˏ();
                }
            }
            this.ॱॱ.ˏ(this);
            if ((eVar == null || eVar.ˋ()) && !z) {
                return this.ॱॱ;
            }
            this.ॱॱ.ᐝ();
            return this.ʽ;
        }

        public void ॱ(D d) {
            super.ॱ(d);
            if (this.ʽ != null) {
                this.ʽ.ᐝ();
                this.ʽ = null;
            }
        }

        public String toString() {
            StringBuilder stringBuilder = new StringBuilder(64);
            stringBuilder.append("LoaderInfo{");
            stringBuilder.append(Integer.toHexString(System.identityHashCode(this)));
            stringBuilder.append(" #");
            stringBuilder.append(this.ˋ);
            stringBuilder.append(" : ");
            gx.ˎ(this.ॱॱ, stringBuilder);
            stringBuilder.append("}}");
            return stringBuilder.toString();
        }

        public void ˎ(String str, FileDescriptor fileDescriptor, PrintWriter printWriter, String[] strArr) {
            printWriter.print(str);
            printWriter.print("mId=");
            printWriter.print(this.ˋ);
            printWriter.print(" mArgs=");
            printWriter.println(this.ᐝ);
            printWriter.print(str);
            printWriter.print("mLoader=");
            printWriter.println(this.ॱॱ);
            this.ॱॱ.ˋ(str + "  ", fileDescriptor, printWriter, strArr);
            if (this.ʼ != null) {
                printWriter.print(str);
                printWriter.print("mCallbacks=");
                printWriter.println(this.ʼ);
                this.ʼ.ˏ(str + "  ", printWriter);
            }
            printWriter.print(str);
            printWriter.print("mData=");
            printWriter.println(ˎ().ˊ(ˊ()));
            printWriter.print(str);
            printWriter.print("mStarted=");
            printWriter.println(ˋ());
        }
    }

    static class e<D> implements kz<D> {
        @NonNull
        private final li<D> ˋ;
        private boolean ˏ;
        @NonNull
        private final o.ld.c<D> ॱ;

        public void ॱ(@Nullable D d) {
            if (le.ॱ) {
                Log.v("LoaderManager", "  onLoadFinished in " + this.ˋ + ": " + this.ˋ.ˊ(d));
            }
            this.ॱ.ˎ(this.ˋ, d);
            this.ˏ = true;
        }

        boolean ˋ() {
            return this.ˏ;
        }

        @MainThread
        void ˏ() {
            if (this.ˏ) {
                if (le.ॱ) {
                    Log.v("LoaderManager", "  Resetting: " + this.ˋ);
                }
                this.ॱ.ॱ(this.ˋ);
            }
        }

        public String toString() {
            return this.ॱ.toString();
        }

        public void ˏ(String str, PrintWriter printWriter) {
            printWriter.print(str);
            printWriter.print("mDeliveredData=");
            printWriter.println(this.ˏ);
        }
    }

    le(@NonNull kv kvVar, @NonNull lh lhVar) {
        this.ˊ = kvVar;
        this.ˋ = c.ˊ(lhVar);
    }

    public void ॱ() {
        this.ˋ.ˋ();
    }

    public String toString() {
        StringBuilder stringBuilder = new StringBuilder(DnsConfig.MAX_CACHE_ENTRIES);
        stringBuilder.append("LoaderManager{");
        stringBuilder.append(Integer.toHexString(System.identityHashCode(this)));
        stringBuilder.append(" in ");
        gx.ˎ(this.ˊ, stringBuilder);
        stringBuilder.append("}}");
        return stringBuilder.toString();
    }

    @Deprecated
    public void ˎ(String str, FileDescriptor fileDescriptor, PrintWriter printWriter, String[] strArr) {
        this.ˋ.ˋ(str, fileDescriptor, printWriter, strArr);
    }
}
